<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <title>图书馆座位管理系统</title>
    <link rel="stylesheet" type="text/css" href="{{ basepath }}static/css/bootstrap.css">
    <script type="text/javascript" src="{{ basepath }}static/js/jquery.js"></script>
</head>
<style>
main{
  width: 100%;
  height: 100%;
  background-image:url('../library/static/img/bckg.jpg');
  background-repeat:no-repeat;
  position: absolute;
  background-size:100%;
  z-index:0;
  padding-top:12%;
 }
.headname{
  text-align: center;
  font-size:30px;
  font-family: Times, TimesNR, 'New Century Schoolbook', Georgia, 'New York', serif;
  color: #666;
    font-weight: 600;
    margin-bottom: 30px;
}

.container{
    width:800px;
    height:auto;
    padding:50px 30px;
    margin:0 auto;
    box-sizing: border-box;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 2px 2px 2px #eee;
}
.form-horizontal{}
.form-horizontal .form-group{
    display: flex;
    justify-content: center;
        padding: 5px;
}
.form-style label{
    font-size: 20px;
    line-height: 40px;
    padding-top:0;
}
.form-style group-style{
    height: 40px;
    line-height: 40px;
    margin-bottom:15px;
}
    .form-style input{
        height:50px;
        font-size:20px;
    }
     .form-style .btn-style{
        text-align:center;
    }
    .form-style .btn-style button{
        border-radius: 2px;
    }
</style>
<body>
<!-------------------------------------- 头部开始 -------------------------------------->


<div class="h044"></div>
<!-------------------------------------- 头部结束 -------------------------------------->
<!-------------------------------------- 内容开始 -------------------------------------->
<main>
    <div class="container" id="from_sign" >
        <p class="headname">校园图书馆座位预约系统</p>
        <form class="form-horizontal form-style" role="form" style="margin: 0px 10px 0px 20px">
            <div class="form-group group-style">
                <label  class="col-sm-2 control-label">学号<span style="color: red">*</span></label>
                <div class="col-sm-10">
                    <input type="text" class="form-control"  id="student_id"
                           placeholder="请输入学号">
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-2 control-label">密码<span style="color: red">*</span></label>
                <div class="col-sm-10">
                    <input type="password" class="form-control" id="password"
                           placeholder="请输入密码">
                </div>
            </div>

            <div class="btn-style">
                <button type="button" class="btn btn-success" style="width:20%;margin-top:10px;margin-bottom: 10px;margin-left: 21px;" onclick="logon()">登录</button>
            </div>
        </form>
    </div>
</main>
<!-------------------------------------- 内容结束 -------------------------------------->
<!-------------------------------------- 尾部开始 -------------------------------------->
<footer>
    <div class="container">

    </div>
</footer>
<!-------------------------------------- 尾部开始 -------------------------------------->
</body>
</html>
<script>
    $(function () {

    });
    function logon() {
        var student_id = $('#student_id').val();
        var password = $('#password').val();
        var data = {
            password: password,
            student_id: student_id,

        }

    $.ajax({
           type: "post",
           url: "{{ basepath }}confired",
           dataType: "json",
           data:data ,
           success: function (data) {
                  if(data.data != "f"){
                      self.location ="{{ basepath }}/library/index"
                  }
                  else{
                      alert("用户名不存在或密码不正确");
                  }
           }
       });
}
</script>
